<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function fn(x) {
                if (x != 0) {
                    sum *= (Math.pow(x,2))
            }
        }
        var n = prompt("圆的半径,请输入x")
        var sum = 3.1415926;
        fn(n);
        document.write(sum)
    </script>
</head>

<body>

</body>

</html>